package com.study.创造型模式.工厂模式.抽象工厂模式.消费者;

import com.study.创造型模式.工厂模式.抽象工厂模式.生产者.BJFactory;
import com.study.创造型模式.工厂模式.抽象工厂模式.生产者.LDFactory;

import java.util.Scanner;

public class PizzaStore {

    public static void main(String[] args) {
        System.out.println("请输入几号窗口");
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        if (s.equals("1")){
            System.out.println("请输入地区风味");
            String s2 = scanner.next();
            if (s2.equals("bj")){
                new OrderPizza(new BJFactory());
            }else if (s.equals("ld")){
                new OrderPizza(new LDFactory());
            }else {
                System.out.println("没有此地区，订购失败");
            }
        }else if (s.equals("2")){
            System.out.println("请输入地区风味");
            String s2 = scanner.next();
            if (s2.equals("bj")){
                new OrderPizza2(new BJFactory());
            }else if (s.equals("ld")){
                new OrderPizza2(new LDFactory());
            }else {
                System.out.println("没有此地区，订购失败");
            }
        }

    }
}
